import { Rect } from "./Matrix";

export function IsInRect(
    nX: number,
    nY: number,
    { minX, minY, maxX, maxY }: Rect,
    border = true // 边缘也进行计入
) {
    if (border) {
        return nX >= minX && nY >= minY && maxX >= nX && maxY >= nY;
    } else {
        return nX > minX && nY > minY && maxX > nX && maxY > nY;
    }
}
